package patterns.decorator;

/**
 * Created by lenovo on 2016/11/25 0025.
 * 装饰类，同样实现了Shape接口，本类抽象
 */
public abstract class ShapeDecorator implements IShape {
    protected IShape decoratedShape;//持有一个shape的接口对象，用于调用多态方法

    public ShapeDecorator(IShape shape) {
        this.decoratedShape = shape;
    }

    @Override
    public void draw() {
        decoratedShape.draw();
    }
}
